package com.qf.flash.ui.chat;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.qf.flash.R;
import com.qf.flash.http.response.SysMsgResponse;
import com.qf.flashlib.adapter.BaseRViewItem;
import com.qf.flashlib.adapter.RViewHolder;

public class SystemNotificationItem extends BaseRViewItem<SysMsgResponse> {
    private Context mContext;

    public SystemNotificationItem(Context mContext) {
        this.mContext = mContext;
    }

    @Override
    public int getItemLayout() {
        return R.layout.item_sysytem_notification;
    }

    @Override
    public void convert(RViewHolder holder, SysMsgResponse entity, int position, int itemSize) {
        holder.setText(R.id.tv_title, entity.getTitle())
                .setText(R.id.tvMsg, entity.getContent())
                .setText(R.id.tv_time, entity.getShowTime());
//        ImageView ivImg = holder.getView(R.id.iv_img);
//        ImageLoader.loadRoundCorners(mContext, entity.getRelateId(), ivImg, 5);
        TextView tvOption = holder.getView(R.id.tv_option);
        if (TextUtils.equals(entity.getType(), "3")) { //未接单
            tvOption.setVisibility(View.VISIBLE);
        } else {
            tvOption.setVisibility(View.GONE);
        }
        holder.setOnClickListener(tvOption);

    }
}
